﻿@using Kovan.Model.ViewModel.Config;
@using Kovan.Model.Entity.Config;
@{
    var Item = Model as ENews ?? new ENews();
    var NewsBase = Item.NewsBase ?? new tb_news();
    var NewsData = Item.NewsData ?? new tb_newsData();
}

<div class="pageContent">
    <form method="post" action="@Url.Content("~/Manage/News/SaveNews")" class="pageForm required-validate"
    onsubmit="return NewsManage.SaveNews(this, NewsManage.navTabAjaxDone);">
    <input type="hidden" name="news_id" value="@NewsBase.news_id" />
    <div class="pageFormContent" layouth="56">
        <p style="width:98%">
            <label>
                标题：</label>
            <input name="title" type="text" style="width:565px;" value="@NewsBase.title" />
        </p>
        <p>
            <label>
                标题颜色：</label>
            <input name="title_color" type="text" size="30" value="@NewsBase.title_color" />
        </p>
        <p>
            <label>
                作者：</label>
            <input name="auditor" type="text" size="30" value="@NewsBase.auditor" />
        </p>
        <p>
            <label>
                关键词：</label>
            <input name="news_keyword" type="text" size="30" value="@NewsData.news_keyword" />
        </p>
        <p>
            <label>
                来源：</label>
            <input name="source" type="text" size="30" value="@NewsBase.source" />
        </p>
        <p>
            <label>
                来源地址：</label>
            <input name="source_url" type="text" size="30" value="@NewsBase.source_url" />
        </p>
        
        <div class="divider">
        </div>
        <p>
            <label>
                首页显示：</label>
            <input name="is_index" type="checkbox" value="1" @(NewsBase.is_index == 0 ? "" : "checked") />
        </p>
        <p>
            <label>
                是否显示：</label>
            <input name="is_view" type="checkbox" value="1" @(NewsBase.is_view == 0 ? "" : "checked")/>
        </p>
        <p>
            <label>
                是否置顶：</label>
            <input name="is_top" type="checkbox" value="1" @(NewsBase.is_top == 0 ? "" : "checked") />
        </p>
        <div class="divider">
        </div>
        <dl class="nowrap" style="width: 98%">
            <dt>标题图片：</dt>
            <dd>
                <div class="img_box">
                    <div>
                        <img id="news_titlePic" width="140" height="130" src="@((string.IsNullOrEmpty(NewsBase.title_pic) || NewsBase.title_pic == "folder.gif") ? Url.Content("~/content/images/folder.gif") : Url.Content("~/content/uploads/News/" + NewsBase.title_pic))" default="@Url.Content("~/content/images/folder.gif")" />
                        <input type="hidden" name="title_pic" value="@NewsBase.title_pic" />
                    </div>
                    <div style="margin-top:5px;">
                        <span><a href="@Url.Content("~/Manage/News/UploadDialog")" target="dialog" rel="news_upload" width="400" height="150"  title="上传标题图片" mask="true">上传</a></span><span><a href="javascript:;" onclick="NewsManage.DeletePic();">删除</a></span>
                    </div>
                </div>
            </dd>
        </dl>
        <div class="divider">
        </div>
        <dl class="nowrap" style="width: 98%">
            <dt>摘要：</dt>
            <dd>
                <textarea name="news_description" cols="134" rows="5">@NewsData.news_description</textarea>
            </dd>
        </dl>
        <dl class="nowrap" style="width: 98%">
            <dt>内容：</dt>
            <dd>
                <div class="unit">
					<textarea class="editor" name="news_content" rows="20" cols="100"
						upLinkUrl="upload.php" upLinkExt="zip,rar,txt" 
						upImgUrl="upload.php" upImgExt="jpg,jpeg,gif,png" 
						upFlashUrl="upload.php" upFlashExt="swf"
						upMediaUrl="upload.php" upMediaExt:"avi">
                        @NewsData.news_content
					</textarea>
				</div>
            </dd>
        </dl>
    </div>
    <div class="formBar">
        <ul>
            <li>
                <div class="buttonActive">
                    <div class="buttonContent">
                        <button type="submit">
                            保存</button></div>
                </div>
            </li>
            <li>
                <div class="button">
                    <div class="buttonContent">
                        <button type="button" class="close">
                            取消</button></div>
                </div>
            </li>
        </ul>
    </div>
    </form>
</div>
